<?php

namespace App\Http\Requests\Admin;

use App\Http\Requests\BaseRequest;

class ImageRequest extends BaseRequest
{
    public function rules()
    {
        $rules = [
            'image' => 'required|image|mimes:jpeg,png,jpg|max:2048', // 上传的图片
            'type'  => 'required|string|in:avatar,face,normal' // 图片类型
        ];

        return $rules;
    }

    public function messages()
    {
        return [
            'image.max' => '图片大小不能超过2MB',
        ];
    }
}
